from django.urls import path
from rest_framework import routers

from byxiaomi.views import (FeedBackViewSets, MyView, StudentsViewSets,
                            TeachersViewSets, drf_show, result, say_hello,
                            submit)

urlpatterns = [
    path("", submit),
    path("sayhello/", say_hello),
    path("submit/", submit),
    path("result/", result),
    # path("upload_yaml_case/", upload_yaml_case),
    path("drf_show/", drf_show),
    path(
        "my_view/",
        MyView.as_view(),
        name="APIView构建单个API视图,没有数据库,有定义接口数据的格式",
    ),
]

router = routers.SimpleRouter()  # 最简单的一个路由
router.register("feedback", FeedBackViewSets)

router.register("students", StudentsViewSets)

router.register("teachers", TeachersViewSets)

# 想要被Django认可的话还要加上下面这行代码
urlpatterns += router.urls
